package cn.csc.framework.pay.core.client.impl.tl;

import cn.csc.framework.common.exception.ErrorCode;
import cn.csc.framework.common.exception.enums.GlobalErrorCodeConstants;
import cn.csc.framework.pay.core.client.AbstractPayCodeMapping;

import java.util.Objects;

import static cn.csc.framework.pay.core.enums.PayFrameworkErrorCodeConstants.*;


public class TLPayCodeMapping extends AbstractPayCodeMapping {

    public static final String VALIDATA_SIGN_CODE = "100100";

    public static final String VALIDATA_SIGN_MESSAGE="签名失败";


    @Override
    protected ErrorCode apply0(String apiCode, String apiMsg) {
        if (Objects.equals(apiCode, "0000")) {
            return GlobalErrorCodeConstants.SUCCESS;
        }
        if (Objects.equals(apiCode, "-99999")) {
            return PAY_EXCEPTION;
        }
        if (!Objects.equals(apiCode, "0000")) {
            return PAY_LIANTONG_EXCEPTION;
        }
        return null;
    }
}
